<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<html>
<head>
<title>Code Conventions for the Java(TM) Programming Language: Contents</title>
</head>
<body bgcolor="#ffffff">
 
<table width="100%"><tr>
<td><!-- font size="-1" -->
CONTENTS | PREV | <a href="CodeConventions.doc.html">NEXT</a> <!-- | <a href="CodeConventions.doc.html">INDEX</a>  -->
<!-- /font --></td><td align=right></td>
</tr></table>
<hr>
<p>

<center>
<font size="+2"><b>Code Conventions for the Java<SUP><FONT SIZE="-2">TM</FONT></SUP> Programming Language</b></font><p>
Revised April 20, 1999
<!-- <font size="+1"><b></b></font><br> -->
</center>
<p>
<hr>

<TABLE BORDER=0 WIDTH="100%">
<tr>
<td width=40></td>
<td width=40></td>
<td width=40></td>
<td width=40></td>
<td></td>
</tr>


<dl>
<dt></dt>
<dd><br>
<a href="CodeConventions.doc.html">
<b><font size="+2">
	1	 
<a href="CodeConventions.doc.html#a18407">Introduction</a></a></font></b>


<dl>
<dt></dt>
<dd>
<b>1.1	 
<a href="CodeConventions.doc.html#a16712">Why Have Code Conventions</a></a>
</b>

<dd>
<b>1.2	 
<a href="CodeConventions.doc.html#a16729">Acknowledgments</a></a>
</b>

</dl>
<dd><br>
<a href="CodeConventions.doc1.html">
<b><font size="+2">
	2	 
<a href="CodeConventions.doc1.html#a16732">File Names</a></a></font></b>


<dl>
<dt></dt>
<dd>
<b>2.1	 
<a href="CodeConventions.doc1.html#a647">File Suffixes</a></a>
</b>

<dd>
<b>2.2	 
<a href="CodeConventions.doc1.html#a253">Common File Names</a></a>
</b>

</dl>
<dd><br>
<a href="CodeConventions.doc2.html">
<b><font size="+2">
	3	 
<a href="CodeConventions.doc2.html#a3043">File Organization</a></a></font></b>


<dl>
<dt></dt>
<dd>
<b>3.1	 
<a href="CodeConventions.doc2.html#a11684">Java Source Files</a></a>
</b>


<dl>
<dt></dt>
<dd>
<b>3.1.1	 
<a href="CodeConventions.doc2.html#a3441">Beginning Comments</a></a>
</b>

<dd>
<b>3.1.2	 
<a href="CodeConventions.doc2.html#a277">Package and Import Statements</a></a>
</b>

<dd>
<b>3.1.3	 
<a href="CodeConventions.doc2.html#a1852">Class and Interface Declarations</a></a>
</b>

</dl>
</dl>
<dd><br>
<a href="CodeConventions.doc3.html">
<b><font size="+2">
	4	 
<a href="CodeConventions.doc3.html#a262">Indentation</a></a></font></b>


<dl>
<dt></dt>
<dd>
<b>4.1	 
<a href="CodeConventions.doc3.html#a313">Line Length</a></a>
</b>

<dd>
<b>4.2	 
<a href="CodeConventions.doc3.html#a248">Wrapping Lines</a></a>
</b>

</dl>
<dd><br>
<a href="CodeConventions.doc4.html">
<b><font size="+2">
	5	 
<a href="CodeConventions.doc4.html#a385">Comments</a></a></font></b>


<dl>
<dt></dt>
<dd>
<b>5.1	 
<a href="CodeConventions.doc4.html#a216">Implementation Comment Formats</a></a>
</b>


<dl>
<dt></dt>
<dd>
<b>5.1.1	 
<a href="CodeConventions.doc4.html#a680">Block Comments</a></a>
</b>

<dd>
<b>5.1.2	 
<a href="CodeConventions.doc4.html#a341">Single-Line Comments</a></a>
</b>

<dd>
<b>5.1.3	 
<a href="CodeConventions.doc4.html#a342">Trailing Comments</a></a>
</b>

<dd>
<b>5.1.4	 
<a href="CodeConventions.doc4.html#a286">End-Of-Line Comments</a></a>
</b>

</dl>
<dd>
<b>5.2	 
<a href="CodeConventions.doc4.html#a16838">Documentation Comments</a></a>
</b>

</dl>
<dd><br>
<a href="CodeConventions.doc5.html">
<b><font size="+2">
	6	 
<a href="CodeConventions.doc5.html#a2991">Declarations</a></a></font></b>


<dl>
<dt></dt>
<dd>
<b>6.1	 
<a href="CodeConventions.doc5.html#a2992">Number Per Line</a></a>
</b>

<dd>
<b>6.2	 
<a href="CodeConventions.doc5.html#a18761">Initialization</a></a>
</b>

<dd>
<b>6.3	 
<a href="CodeConventions.doc5.html#a16817">Placement</a></a>
</b>

<dd>
<b>6.4	 
<a href="CodeConventions.doc5.html#a381">Class and Interface Declarations</a></a>
</b>

</dl>
<dd><br>
<a href="CodeConventions.doc6.html">
<b><font size="+2">
	7	 
<a href="CodeConventions.doc6.html#a430">Statements</a></a></font></b>


<dl>
<dt></dt>
<dd>
<b>7.1	 
<a href="CodeConventions.doc6.html#a431">Simple Statements</a></a>
</b>

<dd>
<b>7.2	 
<a href="CodeConventions.doc6.html#a15395">Compound Statements</a></a>
</b>

<dd>
<b>7.3	 
<a href="CodeConventions.doc6.html#a438">return Statements</a></a>
</b>

<dd>
<b>7.4	 
<a href="CodeConventions.doc6.html#a449">if, if-else, if else-if else Statements</a></a>
</b>

<dd>
<b>7.5	 
<a href="CodeConventions.doc6.html#a454">for Statements</a></a>
</b>

<dd>
<b>7.6	 
<a href="CodeConventions.doc6.html#a460">while Statements</a></a>
</b>

<dd>
<b>7.7	 
<a href="CodeConventions.doc6.html#a465">do-while Statements</a></a>
</b>

<dd>
<b>7.8	 
<a href="CodeConventions.doc6.html#a468">switch Statements</a></a>
</b>

<dd>
<b>7.9	 
<a href="CodeConventions.doc6.html#a472">try-catch Statements</a></a>
</b>

</dl>
<dd><br>
<a href="CodeConventions.doc7.html">
<b><font size="+2">
	8	 
<a href="CodeConventions.doc7.html#a475">White Space</a></a></font></b>


<dl>
<dt></dt>
<dd>
<b>8.1	 
<a href="CodeConventions.doc7.html#a487">Blank Lines</a></a>
</b>

<dd>
<b>8.2	 
<a href="CodeConventions.doc7.html#a682">Blank Spaces</a></a>
</b>

</dl>
<dd><br>
<a href="CodeConventions.doc8.html">
<b><font size="+2">
	9	 
<a href="CodeConventions.doc8.html#a367">Naming Conventions</a></a></font></b>

<dd><br>
<a href="CodeConventions.doc9.html">
<b><font size="+2">
	10	 
<a href="CodeConventions.doc9.html#a529">Programming Practices</a></a></font></b>


<dl>
<dt></dt>
<dd>
<b>10.1	 
<a href="CodeConventions.doc9.html#a177">Providing Access to Instance and Class Variables</a></a>
</b>

<dd>
<b>10.2	 
<a href="CodeConventions.doc9.html#a587">Referring to Class Variables and Methods</a></a>
</b>

<dd>
<b>10.3	 
<a href="CodeConventions.doc9.html#a1255">Constants</a></a>
</b>

<dd>
<b>10.4	 
<a href="CodeConventions.doc9.html#a547">Variable Assignments</a></a>
</b>

<dd>
<b>10.5	 
<a href="CodeConventions.doc9.html#a554">Miscellaneous Practices</a></a>
</b>


<dl>
<dt></dt>
<dd>
<b>10.5.1	 
<a href="CodeConventions.doc9.html#a331">Parentheses</a></a>
</b>

<dd>
<b>10.5.2	 
<a href="CodeConventions.doc9.html#a333">Returning Values</a></a>
</b>

<dd>
<b>10.5.3	 
<a href="CodeConventions.doc9.html#a353">Expressions before `?&#39; in the Conditional Operator</a></a>
</b>

<dd>
<b>10.5.4	 
<a href="CodeConventions.doc9.html#a395">Special Comments</a></a>
</b>

</dl>
</dl>
<dd><br>
<a href="CodeConventions.doc10.html">
<b><font size="+2">
	11	 
<a href="CodeConventions.doc10.html#a186">Code Examples</a></a></font></b>


<dl>
<dt></dt>
<dd>
<b>11.1	 
<a href="CodeConventions.doc10.html#a182">Java Source File Example</a></a>
</b>

</dl>
</dl>

</TABLE>

<!--
<hr>
<h3></h3>
-->

<br>
<hr>
<!-- font size="-1" -->
CONTENTS | PREV | <a href="CodeConventions.doc.html">NEXT</a> <!-- | <a href="CodeConventions.doc.html">INDEX</a>  -->
<!-- /font -->

<hr>
<font size="-1"><i><A HREF="Copyright.doc.html">Copyright</a> &#169 1995-1999, Sun Microsystems, Inc. All Rights Reserved.</i></font>


<!-- This HTML file was created with Quadralay WebWorks Publisher 3.5.0 -->
<!-- by Catherine Holmes -->
<!-- Last updated: Fri Oct 24 11:02:38 1997 -->
 


</body>
</html>
